package com.imooc.validator;

import org.springframework.beans.factory.annotation.Autowired;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.lang.annotation.Annotation;

public class MyConditionValidator implements ConstraintValidator<MyConditionAnnotation,Object> {


    @Override
    public void initialize(MyConditionAnnotation constraintAnnotation) {
        System.out.println("---------------init MyConditionAnnotation");
    }

    @Override
    public boolean isValid(Object value, ConstraintValidatorContext context) {
        System.out.println(value);
        System.out.println(context);
        return false;
    }
}
